package com.ruoyi.cfuser.rescue;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.ruoyi.common.redis.service.RedisService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Date;
import java.util.List;

@SpringBootTest
public class test {

    @Autowired
    private RedisService redisService;

    @Test
    public void test() {
        DateTime date = DateUtil.date();
        String pattern = "yyyy-MM-dd HH:mm:ss";
        String formatDate = DateUtil.format(date, pattern);

        Date date1 = new Date();
        String s = DateUtil.formatDate(date1);

        String formatDate1 = DateUtil.format(date1, pattern);


        System.out.println("---"+formatDate);
        System.out.println("---系统时间"+s);
        System.out.println("---系统时间指定格式化"+formatDate1);

        DateTime parse = DateUtil.parse(formatDate1);
        System.out.println(parse);
    }

    @Test
    public void test2() {
        List<Object> cacheList = redisService.getCacheList("taskList1");
        if (cacheList == null) {
            System.out.println("空");
        }
        if (cacheList != null) {
            System.out.println("不为空");
        }
        if (!(cacheList.size() > 0)){
            System.out.println("长度小于0");
        }
        System.out.println(cacheList);
    }



    @Test
    public void test3() {

    }

}
